<template>
  <div class="share-panel">
    <div class="share-title">分享</div>
    <div class="avatar-list">
      <div v-for="(user, i) in users" :key="i" class="avatar-item" @click="$emit('chat', user)">
        <img :src="user.avatar" class="avatar" />
        <div class="name">{{ user.name }}</div>
      </div>
    </div>
    <div class="action-list">
      <div class="action" v-for="action in actions" :key="action.name" @click="$emit('action', action.name)">
        <van-icon :name="action.icon" size="24" />
        <div class="label">{{ action.label }}</div>
      </div>
    </div>
  </div>
</template>
<script setup>
const props = defineProps({
  users: Array,
  actions: Array
})
</script>
<style scoped>
.share-panel {
  background: #fff;
  border-radius: 24px 24px 0 0;
  padding: 16px 0 0 0;
  min-height: 320px;
}
.share-title {
  text-align: center;
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 12px;
}
.avatar-list {
  display: flex;
  overflow-x: auto;
  padding: 0 12px 8px 12px;
  gap: 12px;
}
.avatar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 56px;
}
.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  margin-bottom: 4px;
}
.name {
  font-size: 13px;
  color: #333;
  text-align: center;
}
.action-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  margin-top: 12px;
  padding: 0 12px 16px 12px;
}
.action {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 64px;
  margin-bottom: 12px;
}
.label {
  font-size: 13px;
  color: #333;
  margin-top: 4px;
}
</style> 